package com.example.controller;

import com.example.base.BaseAction;
import com.example.base.ResponseDto;
import com.example.module.User;
import com.example.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class LoginController extends BaseAction {

    @Resource
    @Lazy
    private UserService userService;

    @PostMapping("/login")
    public ResponseDto<Map<String,String>> login(@RequestBody User user){
        return super.sendSuccessMessage(userService.login(user));
    }
}
